<template>
  <div>
    <van-nav-bar
      :title="title"
      left-text="返回"
      left-arrow
      @click-left="goBack"
      fixed
    />
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: "公共返回组件",
    },
  },
  name: "CommonBack",
  data() {
    return {};
  },
  methods: {
    // 返回上一级目录
    goBack() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="less" scoped>
 /deep/.van-nav-bar{
  background-color: #c00000;
  .van-nav-bar__left{
    i,span{
      color: #fff;
    }
  }
  .van-nav-bar__title{
    font-weight: bolder;
  }
}
</style>